# for module compiling
import os
from building import *

components = ['common',
              'parameter',
              'file_manager',
              'uITC',
              'serial_manager',
              'logger',
              'pid',
              'motor',
              'rc_channel',
              'storage_manager',
              'mc_attitude_control',
              'arming',
              'mc_position_control',
              'ahrs',
              'board_config',
              'sensor_imu',
              'device_manager',
              'sensor_baro',
              'sensor_compass',
              'iomcu',
              'srv_channel',
              'notify',
              'rtc',
              'sensor_gps',
              'mc_loiter',
              'mc_wpnav',
              'xrce_dss',
              'mission',
              'rc_protocol',
              'vehicle',
              'analogin_manager',
              'battery_monitor',
              'rc_mapper',
              'gcs_mavlink',
              'mb_arming',
              'SIM',
             ]

objs = []
cwd  = GetCurrentDir()
list = os.listdir(cwd)

for item in list:
    if not item in components:
        continue

    if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
        objs = objs + SConscript(os.path.join(item, 'SConscript'))

Return('objs')
